package 访问者模式

import "fmt"

type visitor interface {
	visit()
}

type MataChuanFans struct {

}

func (m *MataChuanFans)visit()  {
	fmt.Println("visit 孙笑川")
}

type YaoShuiFans struct {

}

func (m *YaoShuiFans)visit()  {
	fmt.Println("visit 刘波")
}

type iElement interface {
	accept(v visitor)
}

type Element struct {

}

func (i *Element)accept(v visitor)  {
	v.visit()

}

